Batch File to Print PDF from DOS
AcroRd32.exe /t
AcroRd32.exe /t <file.pdf> <printer_name> <printer_driver> <printer_port>
For example:
From Windows, check the printer info by selecting printer properties and print the TestPage
start AcroRd32.exe /t "Y:\901A.pdf" "\\scl1114svr2\SCL1114PSR022A" "SCL1114PSR022A" "http://10.242.198.53/" timeout 6
Filename, Printer Name, Share Name, Port Name # note quotation marks
# timeout is added to allow printer enough time handling and avoid disturbed print sequences
"\\scl1114svr2\SCL1114PSR022A" "SCL1114PSR022A" "http://10.242.198.53/" timeout 6
"\\scl1114svr2\SCL1114PSR013A" "SCL1114PSR013A" "http://10.242.198.55/" timeout 6
use timeout to allow printer handle time
start AcroRd32.exe /t /h "Y:\part1\1103-RISC-VGP-SUR-004805.pdf" // note this prints to default printer
timeout 10
Sample
echo off
start AcroRd32.exe /t /h "Y:\Appendix A3\Appendix_A3c_1122 Doors Ironmongeries\PDF\1122_W_HKB_L&O_A42_001A.pdf" "\\scl1114svr2\SCL1114PSR013A" "SCL1114PSR013A" "http://10.242.198.55/"
timeout 6
start AcroRd32.exe /t /h "Y:\Appendix A3\Appendix_A3c_1122 Doors Ironmongeries\PDF\1122_W_HKB_L&O_A53_001A.pdf" "\\scl1114svr2\SCL1114PSR013A" "SCL1114PSR013A" "http://10.242.198.55/"
timeout 6
start AcroRd32.exe /t /h "Y:\Appendix A3\Appendix_A3c_1122 Doors Ironmongeries\PDF\1122_W_HKB_L&O_A53_002A.pdf" "\\scl1114svr2\SCL1114PSR013A" "SCL1114PSR013A" "http://10.242.198.55/"
exit
The following Reader switches are available:
/n - Launch a new instance of Reader even if one is already open
/s - Don't show the splash screen
/o - Don't show the open file dialog
/h - Open as a minimized window
/p <filename> - Open and go straight to the print dialog
/t <filename> <printername> <drivername> <portname> - Print the file the specified printer.
TO Open PDF from Excel Macro
Private Sub CommandButton1_Click()
dRetVal = Shell("C:\Program Files\Adobe\Reader 11.0\Reader\AcroRd32.exe /A page=6 D:\Users\REXTONG\Desktop\iii.pdf", 1)
End Sub
TO Open PDF from Chrome
<a href="C:\Users\user\Desktop\pdf_open_parameters.pdf#page=3">Page 3</a>
<a href="C:\Users\user\Desktop\pdf_open_parameters.pdf#page=5">Page 5</a>
TO Open PDF from R or batch file
cmd="start AcroRd32.exe /A page=6 C:\\Users\\user\\Desktop\\open.pdf"
shell(cmd)
cmd="start AcroRd32.exe \\A page=6 C:/Users/user/Desktop/cuts.pdf"
shell(cmd)
To split pdf
To split pdf, use print to pdf driver, specifying the pages, to batch split, use dos command print
Windows 7 shortcut to pdf page number
===========================
"C:\Program Files\Adobe\Reader 11.0\Reader\AcroRd32.exe" /A page=18 003122C-104.pdf
Note: the sequence nust follow "Command" "switch" "page num" "pdf name"
Note: the start directory must match the pdf file location
Note: long file names need quotation marks
"C:\Program Files\Adobe\Reader 11.0\Reader\AcroRd32.exe" /A page=18 "\\corp.mtrc.com\rfs\V21\SCL\LAND_SURVEY\SCL LS_North\1103\0100_CSF\19_All Documents Summary\(20150808)1103-CSF-VGP-CS-003160(X)\Method_Statement_-__LRT_-_Erec_1103-CSF-VGP-CS-003160-101.pdf"
May use Batch Files to access a page, and use excel to hyperlink to that batch file
Use Chrome is much simpler but to open large file is slow
Notes: Using chrome to open pdfs is good for small files, big pdfs will be slow and it will be better to split it into small files, some good point in using chrome is the search functions, so providing a key words list at the beginning helps to highlight all major topics, using copy and paste and search, excelent to locate the target and open the pdf.
Therefore to improve the pdf applications, a simple method is just add a html page with keywords and links to point to the target page, particularly adding the key reading notes of the reader.
Excel run shell
The following code will fire when cell D4 is clicked in the worksheet.
Right-click the sheet tab and select "View Code". Paste this into the code window:
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Selection.Count = 1 Then
If Not Intersect(Target, Range("D4")) Is Nothing Then
Dim PrgPath As String
Dim PdfFile As String
Dim PageCode As String
Dim PageNo As Integer
PrgPath = "C:\Program Files\Adobe\Reader 11.0\Reader\AcroRd32.exe"
PdfFile = Range("A1").Value
PageCode = "/A page="
PageNo = Range("A2").Value
Shell PrgPath & " " & PageCode & PageNo & " " & PdfFile, 1
End If
End If
End Sub